Moved function prototypes to bad.h