revised final code, report so far