added functions for reasoning