works now .. keep checking the lenght and do cut
added fix for hackerrank acceptance since you need send exit 0 signal