added data handler and smarter color assignments