how to send variables from classes to instances