extension code halfway working