Use stdbool.h and some formatting
Use int return codes from alloc and add #ifndef in header
Basic percentile iteration working