implemented config file. updated test file. fixed various bugs.