Fixed multiple issues. Version almost working.