restructured chiptools function package