Added software end of stage function - the function provided by RSAI does not work outside of their programme  -