added new inputs, corrected outputs