working bmp parser