added last message parameters, removed dead code,