finished pre-filtereing, implementyed corect gradient descent