fixing bug in single-char params
cleaning code a bit