partial solution to 30