modifying computer_logic algorithm making it smaller