Added some basic logic