fixed loops and stuff
removed cluster class, refactored to struct