fixed memory error
fixed documentation