Updated code to support multiple endpoints. WARNING - config update required, array of fifo endpoints needed