added 3rd tempalte solution and updated 2nd solution