implement basic logic