cleaned up code formatting and style