toString function added in the main

The function "toString" can now be used in the main function