Fixes some performance and adds weighted cluster output