implemented to switch function for reversing.