Added new functions. Modified some others.