rename and fix getItemsCountTable
add getFreeItemsTable
print tables
add print total and fix some bugs