cleaned up pulse analys