#2 fix for unused libs + logic fix