Added strtolower function
Added separate exception for empty input