Making pos0 and pos1 as global variables