fixed some bugs and added version number