added detach option & refactored stamping