analysis added + bugs fixed