Adding docs and some better tests