corrected bug in regularization, removed comments, works now