Add heap allocation for input strings + print mechanism