added cutting a table to size and a few more things