logical circuit, trying to do it using immutable
data structure