minor changes and errors fixed