fixed a few bugs and improved following