Improve box

Remove some tests and improve the box function