code cleanup
fix regularization