changed pos to be the same as max(x,0)