Adding more documentation, re-added a function I carelessly removed