minor
detach() method and minor other changes
detach() in the examples

and a shorter version of attach()
separate sample file for attach() and detach()