added location factory
modified return format for module
modified creation of locations; linked creation of cost index to locations