comments added and one bug found and solved