Adding double[] functions for use where appropriate.