logic is ok