fix the bug with empty input fault
complex stuff clean up
lesser