moved code in pascal from main to seperate function added README