As per some of the comments, I rewrote `getCharacterPosition` to return tuples instead of using references.