Implements quickEncode