centre window function added