Additional code for testing the zero crossing stuff. All works