re-did all code as a project, and optimized the code