Minor changes in the code; some additional comments