Started implementing a proper resize function