implement functions through part 2