added functionality to init function
data transfer between functions