changed getPositionOf function
fixed showSelection