Implemented more general and robust relative values implementation.