Cleaned up the code. Improved frame rate by revoming operations from shader.