tweaked to get it working on lib-proc1