first try at resize code