should probably give credit to where said code came from