Written all functions in proc.h from point of view of STP. Need to check flow though