Added -name parameter, fixed output naming