Changed return to value instead of array by using the first mehtod