not working, need to research forEach and map and using array.length minus 1