Programmer who wrote code to rig an election confess in court