commented and redid code