much cleaning of code and fixed layout issues