added decode function

don't have functions that should be called