Wave Function Collapse Code