Improved parser, restricted string to output and corrected minors bugs