impl of determine cluster (it's a bit java like, but i will work on
style later, now i want it works)