modified print logic, flailed with sorting, -a and default working