[updated code]