initial upload, code is messy