p18 with ugly global variable