Small modifications (wkey in param, comments, code cleanup).