Added loose condition and fixed collision bug discovered in last commit