Arduino code finalized