fix location indexing
pep8, subtransactions