Added Comments and Reduced unnecessary code