added constructor

update class to php 5 standards