another failed attempt at box detection