fixed draw and pulled out the jquery in separate file