Tested code and made improvements to work with directional microphone