WIP: added the logic