implement box parsing