horribly coded upload save method, still not finished