refactored first three assignments