fixed some bugs added others