Refactor torches to avoid a bug and make more consistent and obvious

Also avoid some silliness with rand()