cleanup code
correct prototypes