finished phpdoc
fixed some dead code
returning getOrElse
implemented spec