Added defs for using as library