add all logic