fix bugs and typos
better test