added separate header, deviceFunctions.h, for all device functions (they all need to be inline)