Added conditional statement evaluations and fixed some bugs