adding recording and playback functionality