optimizing removing fragment from equation on touchscreen