unecessary if statement removed
simple solution added