added firmware logic