Removed unused prototypes and changed `min` and `max` to `MIN` and `MAX`
that are macros