used new input output system for new image gradient algorithm