added libs and initial algo