improved docs, fixed bugs