Added upload library and made modifications to existing code.