Base functionality implemented. Still some bugs left. UI looks ugly too.