Worked on function to map room database onto a 2d matrix