4:59pm working version of code