updates from 28 Oct - result of debugging to enter things into PostgreSQL