Redid upload script to better handle typing