Took away unnecessary portions of 'profile' function. In addition, added proper comments and documentation for each function.