Changed what is calculated and added array