imptroved string output, renamed method name and fixed bug