several fixes
a shape enum for easier access, improve sample