now takes multiple inputs