added the attach() method; not finished