fixing another error. Almost ready for simulation