updated prologTerm to use a record to store the location. More regular, less convenient