first bit of working code (in firefox)
implement events, save all tiles ad once.