found way to simulate algebraic datatypes