converted math in secs 6.7-6.8