fixed formatting and code clean up