Made VSMCosSim.py more memory efficient