Fixing minor bugs and adding minor functions. Constructing "specify context" function