Minor code restruct.
Implemented resize