minor grammatical changes and fix bug in code