Some changes as per @mrout's request, and some comments