modified file to include logics