some minor changes made