added basic logic structure