Commented too many lines, fixed that. Also redid some logic.