Complete lib implementation