added docs, renamed functions for more description