Added conditionals and a bunch of other stuff I forgot about