cleaned up download and improved dependency checking