boxcount function

box counting