Incorporated SUN_LEN instead of manual calculations for *BSD compatibility