closed #3, changed file structure, organized code