Added a scoring function, with commented-out options for parallelism