Finding area from coordinates and counting squares