added support for multiple beat detection