fixed matrix and main files, and removed unused functions in coding file