Add circuits library and two extra functions.