reducing number of times the bitmap is printed out