Initial commit
Adapting code to php 5.3.3