fixed some mistakes in 3 and 12 problem