Updated functionality and added working example