Author: eranif@bezeqint.net
Some bug-fixing and minor improvements: mandrav@codeblocks.org
