added spawn and room functions