Attempts at problem 3 and problem 4 done.