Implemented UILIB for Shape Select and minor refactoring