replaced empty sequences with Nil for consistency