modfied zerocrossing to compile