use min from utils.h in window.c