Added frame drawing funtion.