layout refactoring
fixed display bugs in euclid example