beta version code, runs sucessfully