Add Euler function calculation
Restructure everything