problem 3
initial functions for problem 4