File for primary custody... if money is tight, then hire a pro-bono lawyer (some work for women's and children's issues for free); she'll be in school soon, and if you can show that your work hours would coincide with her school hours, then you can provide a safe and stable home for her. Unfortunately, it could get ugly if you have to play dirty pool and reveal your ex's and ex's-lover's drug issues... but it may be worth it. She may even be able to testify that she wishes to live with you... it depends on the laws of your state.
I wish you luck. You obviously love your daughter immensely and it appears she'd be better off with you.
I wish you luck. You obviously love your daughter immensely and it appears she'd be better off with you.