Finish put function and made changes to previous functions