working on pulse algo