trimming input, fixing zero bug