Removed a few more non-essential objects (no need to pass x, only
length needed so compute outside, ditto for length(xnorm), and
complexity)