put fps into separate function