implemented timer (not tested - cannot compile that shit, because library cannot be found? WTF?)