changed =+ in getFlatArea() to +=