initial commit of rewritten library