remove trailing whitespace
make bcp work
add sanity checks