got rid of 3 reduce calls