fixed indexing error. removed initial estimation of parameters.