Formatting
Add comments, tidy code