added a few unit tests
added debounce function and handling resizing the window.