Created draw function and restructured check loops