started writing window functions