Edited the 2 functions provided to make them functional