Inlined many references to get index in solver. Added directionality to touch handler