renamed some variables, importing matrix