Changed file extension and organized code.