changed up some of the code