initial setup and code for problem 28