Updated with the latest code as base

Sorry, didn't use the latest version in the prev example.