improved docs, R tests now passing