cleanup and pulse height scan