fixing Julian's code