Finishing rules changes

Rules changes and UI functionality.