Changed get_position to make it more general.
Completed first draft.