Adding tick rate code - not finished