Changed naming styles and organized code