updated data loading, vectorizing only done once
do vectorizing in before running em