Implement 3d bit matrix