made a clean version of: Added clipboard magic to lua api