added performance measurments. commented out apart from overall speed.