square/pulse bounce by charlie