I've seen this a number of places and always meant to ask, is cachedDirection a global variable or is the scope limited to this file?