redid windowing function to be pretty complicated, using projection then smooth tail off