changed lastPos - many bugs