Almost working resize with a few bugs but still workable