Arranged whitespace
Cleanup and rearrange.
More robust checking of dependencies