New shallow copy function for tables.
Refactored and optimized the box class with a template and local keywords.