Fixing spawn algorithm and adding UI