cleaned adv pass library and added test functions