Obviously written by a C freak using a BSD