Added more of the basic logic