Filled in code changes

Added code to the function stubs and added comments