Working version - 22 seconds