finished resize algorithm and did basic tests to check behavior