Major commit - new algo working, ui working