Cleaned up the code

- removed unnecessary malloc
- spaces, not tabs to indent
- renamed control states to be more logical
- renamed SUSPEND to PAUSE, feels more accurate
- fixed indentation, which was off in places