fix syntax and trivial debug errors and implement the speed test and exit command