Reordered arguments and added some comments