Adding timer functionality