Changed to use prototypes

Removed debug mode