better curve
better piece h sizing
updated version