add modality check and ttl code, move randomness into generateworking memory, change colors