added heap and recursive functions;