modified the functions to be device specific and added two functions