--Fixed so that any array can be passed in. --Corrected evaluation point