Starting to work on the logic