Originally written by Alexandros Stergiakis <sterg at kth dot se>
Adopted by Massimo Manghi <massimo.manghi@rivetweb.org>
