simplified and made the band method more robust