updated library and main script