Added two d simulation code