Changed to implement bitmap's alternative approach