implement code to handle the discrete part of the guard, need to work on the continuous part of the guard