Logic for Onsetsu prototype