Deps order

Fixes #39. Honestly I'm not thrilled with the solution but it works. I think the code could be refactored overall, but this fixes the issue with the least work.