Heavy Code Optimization for PI

Excluding Math functions, transparent mask images etc.