refractoing the entire Lab 12 project