now refreshes cache every 3 seconds by setting cache to nil. Also tidied up some of my code.