Rewrite with 2d bitmap