problem 41
add 42, 43 and start of more efficient 43b