added method resize
refactored
refactored