Completed a naive version