Reimplemented with suggestions.