Refactoring antenna.c to match function diagram in wiki