added decode functions