checkout functions.inc