Fix script layout so that script is loaded before being called, add backup script