Converted the remaining printfs, changed MAX and MIN functions to int types.