added matlab's checkcode thingy