cleaned up comments and code