Updated with code connecting to device