solution to 149 and 150