Use a compile function instead