change code default; add magic functino at end