Added optional argument to concat input in reverse order.