code cleanup

Fixed identation and cleaned the code.