completed  init and draw functions