cleaned up a little bit & minor bugs fixed