bugfix: use abs() when checking for small values
use any() and all() for chains of boolean operators

Signed-off-by: Jacob Emmert-Aronson <jre2718@berkeley.edu>