added nullMatrix function for modularization