some code i wrote for new backup