added more comments and renamed files/variables to make more sense!