refactored
updated example