rearranged variables.
removed unimplemented function.