Added code to interface with hardware