matrix function add
spin lock added