Added and updated some functions