refactored mixInputs by putting into for loops