draft implementation of some logic functions