Move cancel button to bottom (badly)
Tidy up the code a bit, add some comments