I will also be changing this to use a global message counter--using the array length introduces race conditions.