added more comments; changed check for clipboard copying to one line statement