fixed #2 & solved #1 more exactly analyze