Added Code for optimizing sprites.