added type switch buttons, fix problem, cleanup