Added position fetching and associated test code