modifed for all inputs except origin