Finished port implementation in assignment 5