All functions for checkpoint 1 working