Add rooms algorithm