improved the examples a bit
fixed a bug