copied final version from techfair repo