averaging code now has hoagie command that won't make output, has correct indexing again