adding the "logic"