appropriately resetting metrics
R now runs in parallel thread
fixed merge conflicts