Updated comments and refractored function call