add phi and euler numbers and a little refactor