--Added generics stuff
--changed the code to use the window object.