Added alert, trace code

functions for traces added