Moved the degrees function into the functions module