First working regression + weights
work in progress