updating with most of the functionality. will need to add error handling.
updating with majority of functionality, will need to add error handling and raising of error messages