Added sorting, printing, input functionality