moved frame rate calculations inside frame_rate function
created new board class and cleaned up code