broke up into separate functions, added some !s