Partially fixed the drawRec method.