added the beinings of some ideas to work with multipul devices