moved call to rankCorners into the main script