added custom window functions