added audits and fixed several bugs