First variant - complete