Implemented data download. Fixed bugs.