Added addScalar function and created init function to assign matrix all one value