Fixed minor issue
Fixed clear function
Added initial phpunit test