optimization and comments
optimization and code clean up