working code for jacob