cleaned and fixed various issues