Small tidy up, and have started on upload functionality