Added basic resize code, needs fixing