updated input node sorting