Started a condition and added a function

Started a condition and added a function