made functions that use struct Location pointers or references
const-correct