implemented init and draw functions