algo2_nandsim works correctly