Code for hardware side function