added loops for failures and more logging in baseprep