optimizations and framerate counter (toggle with F key)