Created position_difference_test function