updATED CODE