Added init, clear and sum matrix functions.