Moved two functions from comments to discourse

(so they don't get defined twice)