Added precalculation of stacksize and stripping string of whitespace and
newline