- tested and fixed essential code (lest version did not work)