Updated drawing functions for ios 7