Removed unused variable; Fixed sprintf format