Modified global variable declaration and added option for backup name