updated script with testing in ubuntu 12.04 64bit