merging lib version from 'wip' branch