work ok. Funny to write this program again
don't have time to waste rewriting 'working' code
index and backref