fix realloc
Separate file for common functions
Print functions
Split find and grammar