changed getPosition function, fixed indents