finished resizer code