fixed warnings, made batch more functional