Replace vectors & index-of with maps
Okay I think mod-pow works now hoo ray