working version without lazy