Added alerts and cleaned up