started passing array to mean & median method