remove empty newlines and fix that ugly character.length - 2 ;)