added code for playing functions. Needs recording now.
added minor to comments