get end position function, debugging end positions