Changed order of extend at the suggestion of @katowulf