Fixed bug in inFinalQuadrant() function