modularize and change timing, compiles, but untested