finished all box checking functions.