fixed some bugs and added some features, first version working