Wrote main library part