Remove unused ivars.
Ensure rooms is an array by calling Array(rooms).
Major rewrite.