[ Update ] Moving to $window for better code