added tachometer code