added real logic functions