enclose everything in an immediate function