added more set code and simplified some other files