Pulled in from 2013-12-03-edinburgh repository and modified slightly to compare performance of NumPy dot product to naive list-based implementation