Some changes added
Added phpunit tests