First stage of its working. Square wave overlay still needs work.