improve logic.toy