Included comments and removed unused code