Completed all functions. Awaiting testing.