added sample code to help connect to device