Added downscaling code and updated master swift script