Updated code to listen forever. This is probably the most inefficient way to do it; be warned that it may use up a lot of battery.