Added time filter, and cleaned up stuff.