M2 function added
test and check fixes