added encoding methods