Optimized mouse selection of wedges a bit, cleaned up code