Added comments and bodies for functions