mem free bug fixed (size = 0, last = -1, array = NULL)
input, output works properly
sort written, but does not work
sorting fixed :)