Adding the index argument to the function argument in populateMap

Also adding tests (there should've been tests...)
I incorrectly thought this was the param names instead of the signature.  Not intentional.