Added new functions and renamed things