Updated solution with latest bits