Smart multi-lock version added
Changed type size to iterate over all functions