added conditional and tested