Completed functions in stubs

As per the assignment