working on programming assignment 1 - complete function in progress