Added More comments and fixed minor issues