logic with types