More useful implementation.
Minor bug