commented and organized code