added mutex and storing sequneces of coordinates