Commented the code to make it easier to use.