fixed typo in compute slices that gives total number of parameters. Also change signature of norm2 objective function.