moved condition to right place
fixed comments