Rewrote conversation part, fixes a free() issue. Cleaned up code.