massive cleanup; added sequence numbers to log output