added window function graphics and fixed some bugs