Re-ordered elements in form, added more comments, finished code.