added decode and foo