Added Conditionals to optimize