Adding functions for part 2