some comments added and some little problems fixed