rework into pgorafunc 9.4