added frame rate counter and working version