refactored code, reduced image sizes