Added functions. Modified others.