Made changes
Fixed error when empty input
Fix piping