Edited draw function