allpins method added, fixed some bugs