add problem 36, move some code to shared