fixed a bunch of bugs and added readme