some more proper logic