initialized tex in calcTexture differently and added a comment that explains why. Should resolve issue #46