Implemented WINDOW with some flaws