Completed Rules appending

done rules appending. rulesToString function added for appending
purposes.