implement DotMatrix class