Added the function

added the function to calculate any value that would be placed in  the
array