Updated backtrack.m, added all the code