finished LMS algorithm implementation