add lib and kinda working version