add support for 5 curves (wip-untested)