If statement and changes

Created if statement and made some changes to get it to work