code was formatted and some of names changed