add new logic with testing: determine and stochastic; change struct types to normal types with typedef instruction, etc.