further simplified the code, added a test signal
further simplified the code, added a test signal