Add a proper start and fixes some bugs