Cleaning up code, fixing markup, adding conditional