Group inputs by address

closes #396