added sleep and cleaned up.