added state() to timer class which returns the current timer state