Wrote function documentation, some improvements