Optimization of room functions