add new logic that supports order of operations