removed functions, cleaned up comments and formatting