See Programming Examples in OTP documentation<br><br>-- <br>Maxim Treskin