attempt to pull the code together