fixed code formatting
Fixed test case
Code formatting and cleanup