Added code from @McNiles (#2). Altered the getGaussSimilarity function from standard normal distribution to our similarity function specified in #1.