adding basic logic (I have to improve this :S)