Code titdy

Remove residual pulse code, and tidy comments
Edited