add error handling, update formatting