Fixed code according to his specifications

- only 1 return in a function
- fixed spaces