Adding and defining various functions