Update: minor improvements, matrix arithmetics