reorganized code/made it presentable