cleanup and add documentation
cleanup framerate calculation, allow float framerate