added more comment regarding else(x!=0)