Removed alert-statements and added some comments