working on attaching functions