Naive implemeentation for Problem 3