First improvement of rhoref

Using Matlab's profiler showed that line 18 of this function was one of the more time consuming.
More improvements to come :)