Reimplemented athinfod.c in Python