change all tabs for spaces and adjust some code