add some code for problems 26 and 27