Further optimization to blit function