function getLongestSideLength added