Fixed (my) bug; fixed a transcript bug; reorganized code; added comments