Re-designed code from the start