Added Comments to each function