Repaired code sample