Added error check to lm composer
Replaced SparseMap with SparseVector
More efficient sorting and combining weights