added a function formatUnderLine2ConcaveConvex and fixed a few bugs