Fixing my function.
Better function.