Some logic and touch stuff