Finished remaining functions
completed ex4