Fixed all known bugs. Removed the worthless resize function.