fixed smooth, now it seems to work with any window