changed bitmap accessing function
memory leak fixed
added function for accessing bitmap on the fly