changed Triangle member atoms to non-pointer, fixed several mini bugs