cleaned up variable inheritance code