stdlib.h include added for abort()