Added header guard to device.h, wrote typedef in a cleaner way