Added commenting, removed redundancy