naive version coded and submitted