It's very hard to make heads or tails out of your code. For instance, in prior posts "swt" is a function, but in the code above it appears to be a variable. Which is it? Then you have large portions of the code that are not used, such as the base() function, but that we have to wade through in order to find out that it is not used.