moved isempty from alias to function
cleaned a tiny bit