Initial Working version
revised to work with playback