added convenience function unlocknload (incomplete)
rearranged code in file