V2

fixing some bugs