made a better resize, with version test and everything