Implemented new functionality. /See comment below/