updated complete example