Intentional behavior and motivation; a cognitive theory