Final code w/ IR sensor