using BackTracking to find solutions