added minor functions and fixed layout