Added if-then-else made by Sayan