cleaning up the SCAL code