Fixed logic in intial if statements used and instead of or