Modified code to fit 4Tronix circuit