formatted, added nil tests