added basic zigzag encoding with updated butils, closes #5