working to fix mem leak
fixed memleaks
undated documentation