fixed typo in calcQuadrant function