cleaned up small section of code, still issues with storing recovery variables