Changed the PrintTable

Refactored it to a more suitable code. Made couple of bugfixes and
primarily added support for detecting multiple items in a cart and
grouping them.

Need to work on speed optimizations so as to improve efficiency