implemented bin extraction