updates to make this a useful npm package