Refactored Dyadmino class.