style
convert np.dot(A, B) to A.dot(B)
refactor createLM to reduce indentation levels